
package com.xuecheng.teaching.common.constant;


import com.xuecheng.common.domain.code.ErrorCode;

/**
 * 教学管理管理服务业务异常枚举类
 * <hr>
 * 后四位错误代码由开发者开发中进行定义<br>
 * 教学管理服务前两位错误服务标识为：13(在 {@link ErrorCode} 中定义)
 * 模块错误代码定义如下：
 * <ul>
 *   <li>公司--定义模块代码为： 00</li>
 *   <li>教师模块--定义模块代码为： 01</li>
 *   <li>教师课程信息关联--定义模块代码为： 02</li>
 *   <li>课程计划作业--定义模块代码为： 03</li>
 *   <li>课程计划作业记录--定义模块代码为： 04</li>
 * </ul>
 *
 * @Description: 定义教学管理中的业务异常代码
 * @author : Flippy
 * @date: 2019/9/11
 */
public enum TeachingErrorCode implements ErrorCode {
	E_130101(130101,"保存教师信息失败"),
	E_130102(130102,"教师手机信息已存在，无法添加"),

	E_130201(130201,"保存教师和课程关联信息失败"),
	E_130202(130202,"老师和教师已经关联，无需关联"),
	E_130203(130203,"教师信息不存在"),
	E_130204(130204,"课程信息状态异常"),

	E_130301(130301,"修改人不匹配,无法修改"),
	E_130302(130302,"操作课程计划作业信息失败"),
	E_130303(130303,"作业不能创建在一级课程计划下"),


	E_130401(130401,"课程计划作业不存在,无法操作课程计划作业记录"),
	E_130402(130402,"操作课程计划记录失败"),
	E_130403(130403,"批改作业记录状态不合法,无法操作"),
	E_130404(130404,"批改作业失败"),
	E_130405(130405,"批改教师不是同一个教师,无法修改"),
	E_130406(130406,"作业未提交,无法审批"),
	E_130407(130407,"作业记录信息不存在,无法操作"),
	E_130408(130408,"作业记录已经提交,无需提交"),
	E_130409(130409,"此机构没有绑定该课程,无需提交"),
	E_130410(130410,"作业删除失败"),
	E_130411(130411,"作业绑定了课程计划，或以发布 无法删除"),
	E_130412(130412,"作业批阅增量计数失败"),
	E_130413(130413,"作业批阅增量计数失败,没有待批阅数"),
	E_130414(130414,"保存学生作业记录失败"),
	E_130415(130415,"更新课程作业统计数量失败"),
	E_130416(130416,"创建courseWorkRec表失败"),


	E_130500(130500,"您输入的手机验证码有误，请重新输入！"),

	E_130501(130501,"该机构名称已存在，请更换其它名称"),
	E_130502(130502,"该机构账号已存在，请更换其它账号名"),

	E_130503(130503,"该机构的联系方式已存在，请更换其它手机号"),

	E_130504(130504,"未查询到匹配的机构信息,无法修改"),
	E_130505(130505,"该机构已审核完成，无需再次审核"),
	E_130506(130506,"机构id不存在"),
	E_130507(130507,"关键信息不存在"),
	E_130508(130508,"获取课程作业提交信息失败"),


	E_130601(130601,"接口信息和传入参数不一致"),
	E_130602(130602,"保存作业信息失败"),
	E_130603(130603,"作业信息不存在"),
	E_130604(130604,"修改作业信息失败"),

	E_131000(131000,"未成功获取手机验证码，请稍候重试"),
	E_131001(131001,"获取上传文件凭证失败，请稍候重试"),
	E_131002(131002,"获取文件的下载地址失败，请稍候重试"),

	E_132000(132000,"接口调用创建账号异常"),
	E_132001(132000,"接口调用检查用户名异常"),
	E_132002(132000,"接口调用检查手机号异常"),
	E_132003(132003,"用户信息不能为空"),
	;

	private int code;
	private String desc;
		
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

	TeachingErrorCode(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}


	public static TeachingErrorCode setErrorCode(int code) {
       for (TeachingErrorCode errorCode : TeachingErrorCode.values()) {
           if (errorCode.getCode()==code) {
               return errorCode;
           }
       }
	       return null;
	}
}
